package org.come.Jpanel;

import com.tool.btn.FormsOnOffBtn;
import com.tool.btn.LiangHaoItemBtn;
import com.tool.role.RoleData;
import com.tool.tcpimg.UIUtils;

import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.geom.RoundRectangle2D;

public class XinJianJpanel extends JPanel implements MouseListener {
    private JTextField xNum;
    private LiangHaoItemBtn btnDo, btnNo;
    ImageIcon icon;
    private JLabel text;
    public XinJianJpanel() throws Exception {
        this.setPreferredSize(new Dimension(532, 149));
        this.setLayout(null);
        this.setBackground(UIUtils.Color_BACK);

        xNum = new JTextField();
        xNum.setBounds(30, 55, 290, 17);
        xNum.setOpaque(false);
        xNum.setBorder(BorderFactory.createEmptyBorder());
        xNum.setBackground(UIUtils.Color_BACK);
        xNum.setForeground(Color.WHITE);
        xNum.setCaretColor(Color.white);
        this.add(xNum);

//        lianghao = new JLabel();
//        lianghao.setBounds(215, 58, 120, 15);
//        lianghao.setForeground(Color.WHITE);
//        lianghao.setFont(new Font("宋体", 0, 14));
//        this.add(lianghao);

        text = new JLabel();
        text.setBounds(30, 35, 500, 15);
        text.setForeground(Color.WHITE);
        text.setFont(new Font("宋体", 0, 14));
        this.add(text);

        btnDo = new LiangHaoItemBtn("inkImg/newbutton/B20.png", 1,this,6, "确定");
        btnDo.setBounds(88, 95, 59, 24);
        btnDo.setFont(UIUtils.TXT_hyzjt16);
        btnDo.setVerticalTextPosition(SwingConstants.CENTER);
        btnDo.setHorizontalTextPosition(SwingConstants.CENTER);
        this.add(btnDo);

        btnNo = new LiangHaoItemBtn("inkImg/newbutton/B20.png", 1,this,9, "取消");
        btnNo.setBounds(388, 95, 59, 24);
        btnNo.setFont(UIUtils.TXT_hyzjt16);
        btnNo.setVerticalTextPosition(SwingConstants.CENTER);
        btnNo.setHorizontalTextPosition(SwingConstants.CENTER);
        this.add(btnNo);
    }


    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        if (icon == null)
            icon = new ImageIcon("inkImg/newbackground/XJBK.png");
        text.setText("可以自选4到6位的任意靓号 , 剩余积分 " + RoleData.getRoleData().getLoginResult().getMoney().toString());
        g.drawImage(icon.getImage(), 0, 0, 532, 149, this);
    }

    @Override
    public void mouseClicked(MouseEvent e) {

    }

    @Override
    public void mousePressed(MouseEvent e) {

    }

    @Override
    public void mouseReleased(MouseEvent e) {

    }

    @Override
    public void mouseEntered(MouseEvent e) {

    }

    @Override
    public void mouseExited(MouseEvent e) {

    }

    public JTextField getxNum() {
        return xNum;
    }

    public void setxNum(JTextField xNum) {
        this.xNum = xNum;
    }

    public LiangHaoItemBtn getBtnDo() {
        return btnDo;
    }

    public void setBtnDo(LiangHaoItemBtn btnDo) {
        this.btnDo = btnDo;
    }

    public LiangHaoItemBtn getBtnNo() {
        return btnNo;
    }

    public void setBtnNo(LiangHaoItemBtn btnNo) {
        this.btnNo = btnNo;
    }

    public ImageIcon getIcon() {
        return icon;
    }

    public void setIcon(ImageIcon icon) {
        this.icon = icon;
    }


}
